from django.db import models


# Create your models here.
class Stock(models.Model):
    name = models.CharField(verbose_name="股票名称", max_length=16)
    latest_price = models.DecimalField(verbose_name='最近成交价格', decimal_places=3, max_digits=10)
    latest_mum = models.DecimalField(verbose_name='最近成交数量', decimal_places=3, max_digits=10)
    total_num = models.IntegerField(verbose_name='发行量')
    total_price = models.DecimalField(verbose_name='市值',decimal_places=3, max_digits=10)
    change_rate = models.DecimalField(verbose_name='浮动',decimal_places=3, max_digits=10)

    class Meta:
        verbose_name = "股票信息"
        verbose_name_plural = verbose_name

    def __str__(self):
        return "{0}/{1}".format(self.id, self.name)

